Fix bottom-oriented notebook tabs on Win32. #399253
authorCody Russell <bratsche@src.gnome.org>
Sun, 1 Apr 2007 18:50:38 +0000 (18:50 +0000)
committerCody Russell <bratsche@src.gnome.org>
Sun, 1 Apr 2007 18:50:38 +0000 (18:50 +0000)
svn path=/trunk/; revision=17575

ChangeLog
modules/engines/ms-windows/msw_style.c

index 7df72a3599101eda2cdc9843b38e17662d282c18..2508844a83aaa3fc655c1be98863ed3290591521 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-01  Cody Russell  <bratsche@gnome.org>
+
+       * modules/engines/ms-windows/msw_style.c: Fix rendering of
+       notebook tabs when they are bottom-oriented.  Fixes #399253.
+
 2007-03-31  Elijah Newren  <newren gmail com>
 
        * gdk/x11/gdkwindow-x11.c (setup_toplevel_window,
index 49ab0fb801950b1ad2533afb3c584f028a55d122..5fe0c2029aff6298d927238beedf51ee3b521279 100755 (executable)
@@ -2413,18 +2413,12 @@ draw_extension (GtkStyle * style,
              }
            else if (real_gap_side == GTK_POS_BOTTOM)
              {
-               x2 = x;
-               y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder);
+               x2 = 0;
+               y2 = 0;
                w2 = width;
                h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2);
-               target = window;
-
-               /* If we are currently drawing the right-most tab (any state)... */
-               if (widget->allocation.x + widget->allocation.width - border_width == x + width)
-                 {
-                   x2--;
-                   w2--;
-                 }
+               pixmap = gdk_pixmap_new (window, w2, h2, -1);
+               target = pixmap;
              }
 
            if (xp_theme_draw (target, tab_part, style, x2, y2, w2, h2, state_type, NULL /*area*/))
@@ -2473,12 +2467,25 @@ draw_extension (GtkStyle * style,
                                   h2--;
                                 }
                             }
+                          else if (real_gap_side == GTK_POS_BOTTOM)
+                            {
+                              x2 = x;
+                              y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder);
+                              w2 = width;
+                              h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2);
+                              /* If we are currently drawing the right-most tab (any state)... */
+                              if (widget->allocation.x + widget->allocation.width - border_width == x + width)
+                                {
+                                  x2--;
+                                  w2--;
+                                }
+                            }
 
                           gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x2, y2, w2, h2, GDK_RGB_DITHER_NONE, 0, 0);
 
                           g_object_unref (G_OBJECT (pixbuf));
 
-                          if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT)
+                          if (real_gap_side == GTK_POS_LEFT || real_gap_side == GTK_POS_RIGHT || real_gap_side == GTK_POS_BOTTOM)
                             {
                               g_object_unref (pixmap);
                             }